home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / 3_0 / DOUBLEDE / SCROLLPO.C < prev    next >
C/C++ Source or Header  |  1988-06-19  |  877b  |  46 lines

  1. #include <ControlMgr.h>
  2.  
  3. #define        SCROLLBARWIDTH        15
  4.  
  5. poshscroll(theHScroll,theWindow)
  6. ControlHandle    theHScroll;
  7. WindowPtr        theWindow;
  8. {
  9.     Rect        r;
  10.  
  11.     r = theWindow->portRect;
  12.     r.top = r.bottom - SCROLLBARWIDTH;
  13.     r.right -= SCROLLBARWIDTH;
  14.  
  15.     --r.left;
  16.     ++r.bottom;
  17.     ++r.right;
  18.     HideControl(theHScroll);
  19.     SizeControl(theHScroll,r.right-r.left,r.bottom-r.top);
  20.     MoveControl(theHScroll,r.left,r.top);
  21.     ShowControl(theHScroll);
  22.  
  23.     ValidRect(&(**theHScroll).contrlRect);
  24. }
  25.  
  26. posvscroll(theVScroll,theWindow)
  27. ControlHandle    theVScroll;
  28. WindowPtr        theWindow;
  29. {
  30.     Rect        r;
  31.  
  32.     r = theWindow->portRect;
  33.     r.left = r.right - SCROLLBARWIDTH;
  34.     r.bottom -= SCROLLBARWIDTH;
  35.  
  36.     --r.top;
  37.     ++r.bottom;
  38.     ++r.right;
  39.     HideControl(theVScroll);
  40.     SizeControl(theVScroll,r.right-r.left,r.bottom-r.top);
  41.     MoveControl(theVScroll,r.left,r.top);
  42.     ShowControl(theVScroll);
  43.  
  44.     ValidRect(&(**theVScroll).contrlRect);
  45. }
  46.